function TS = addTS(ts1, ts2)
% TS = addTS(ts1, ts2)  Add two TS structures, element by element
% (ts1 + ts2).  If ts2 is a scalar then add ts2 to each element of ts1.
%

TS = ts1;

if isstruct(ts2)
    TS.data = ts1.data + ts2.data;
else
    if isstruct(ts1);
        TS.data = ts1.data + ts2;
    else
        TS = ts1 + ts2;
    end
end

return
